<!-- 组件方式引入header -->
@component('backend.index.frame')
    @slot('title')
        <title>{{$title}}</title>
    @endslot
    @slot('script')
        <!-- 页面自身js -->
        <script type="text/javascript" src="/static/js/{{$identity}}.js"></script>
        @endslot
        @endcomponent
        </head>
        <body class="hold-transition sidebar-mini layout-fixed">
        <div class="wrapper">
            <!--顶部栏目-->
        <?php require_once resource_path('views') . '/backend/index/navbar.blade.php'; ?>
        <!-- 组件方式,引入侧边栏 -->
            @component('backend.index.sidebar')
                @slot('identity'){{$identity}}@endslot
                @slot('sidebar'){{$sidebar}}@endslot
            @endcomponent
            <div class="content-wrapper" id="group_examine">
                <!-- 内容标题（页面标题） -->
                <section class="content-header">
                    <div class="container-fluid">
                        <div class="row mb-2">
                            <div class="col-sm-6">
                                <h1>公司</h1>
                            </div>
                            <div class="col-sm-6">
                                <ol class="breadcrumb float-sm-right">
                                    <li class="breadcrumb-item"><a href="#">主页</a></li>
                                    <li class="breadcrumb-item active">企业申请列表</li>
                                </ol>
                            </div>
                        </div>
                    </div>
                </section>

                <!-- 主体内容 -->
                <section class="content">
                    <div class="col-md-12">
                        <div class="card card-primary">
                            <div class="card-header">
                                <h3 class="card-title">公司成员</h3>
                            </div>
                            <input type="hidden" id="lcm_lingpai" value="{{csrf_token()}}">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label class="label control-label">状态:</label>
                                            <select class="form-control" v-model="status">
                                                <option value="-1">全部</option>
                                                <option value="1">待审核</option>
                                                <option value="3">审核通过</option>
                                                <option value="4">审核拒绝</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label class="label control-label">用户名称:</label>
                                            <div class="input-group">
                                                <input type='text' class="form-control" v-model="keyword" />
                                                <button class="btn btn-primary btn-sm" @click="getDataList">搜索</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="row" style="margin-top: 20px;">
                                    <div class="col-md-12">
                                        <table class="table table-bordered table-hover text-center">
                                            <thead>
                                                <th class="text-center" style="width: 15%">用户头像</th>
                                                <th class="text-center" style="width: 15%">用户昵称</th>
                                                <th class="text-center" style="width: 35%">申请理由</th>
                                                <th class="text-center" style="width: 10%">申请时间</th>
                                                <th class="text-center" style="width: 10%">审核时间</th>
                                                <th class="text-center" style="width: 15%">操作</th>
                                            </thead>
                                            <tbody v-if="datalist.length > 0">
                                                <tr v-for="(item, index) in datalist">
                                                    <td class="text-center image" style="width: 15%">
                                                        <img :src="item['headimgurl']" class="img-circle elevation-2" alt="用户头像" style="width: 50px;height: 50px;">
                                                    </td>
                                                    <td class="text-center" style="width: 15%">@{{ item['nickname'] }}</td>
                                                    <td class="text-center" style="width: 35%">@{{ item['apply_reason'] }}</td>
                                                    <td class="text-center" style="width: 10%">@{{ item['createtime'] }}</td>
                                                    <td class="text-center" style="width: 10%">@{{ item['examine_time'] }}</td>
                                                    <td class="text-center" style="width: 15%">
                                                        <button type="button" class="btn btn-primary btn-sm" v-if="item.status == 1" @click="operateApply(item.id, 1)">通过</button>
                                                        <button type="button" class="btn btn-danger btn-sm" v-if="item.status == 1" @click="operateApply(item.id, 2)">拒绝</button>
                                                        <label class="text-primary" v-if="item.status == 3">已接受</label>
                                                        <label class="text-danger" v-if="item.status == 4">已拒绝</label>
                                                    </td>
                                                </tr>
                                            </tbody>
                                            <tbody v-else>
                                                 <tr><td colspan="6" class="text-center">暂无数据</td></tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <div class="card-footer">
                                @component('backend.index.pagination')
                                @endcomponent
                            </div>
                        </div>
                    </div>

                </section>
            </div>

            <!--底部栏目-->
            <?php require_once resource_path('views') . '/backend/index/footer.blade.php'; ?>
        </div>
        </body>
        </html>
